import request from "@/lib/utils/request";
import { PaginationType, Response, ResponseWithPagination } from "../common";
import type { User } from "../system/user.d";

export const getUserListApi = (
  params: PaginationType,
): ResponseWithPagination<User> => {
  return request.get("/system/user/list", { params });
};

export const deleteUserApi = (id: string): Response<null> => {
  return request.delete(`/system/user/${id}`);
};

export const getUserInfoApi = (id: string): Response<User> => {
  return request.get(`/system/user/${id}`);
};

export const updateUserApi = (data: User): Response<null> => {
  return request.put("/system/user", data);
};

export const createUserApi = (data: User): Response<null> => {
  return request.post("/system/user", data);
};
